<template>
  <PageWrapper dense contentFullHeight fixedHeight class="p-4">
    <div class="p-4 mb-2 bg-white">
      <BasicForm @register="formregister" compact />
    </div>

    <RecordCard :api="getPhysicalList" :params="params" />
    <!--<BasicTable
      @register="registerTable"
      :rowSelection="{ type: 'checkbox', onChange: onSelectChange }"
    >
      <template #headerTop> </template>
      <template #toolbar>
        <Select
          ref="select"
          style="width: 120px"
          v-model:value="dataShowMode"
          :options="dataShowOption"
          @change="handleDataShowChange"
        />
      </template>
    </BasicTable>-->
  </PageWrapper>
</template>
<script lang="ts" setup>
  import { ref } from 'vue';

  import { BasicTable, useTable } from '@/components/Table';
  import { PageWrapper } from '@/components/Page';
  import { BasicForm, FormSchema, useForm } from '@/components/Form/index';
  import RecordCard from '../components/RecordCard.vue';

  import { useMessage } from '@/hooks/web/useMessage';
  import { getBasicColumns, getFormConfig, getAdvanceSchema, formregister } from './column';
  import { batchDeletePhysical, deletePhysicalByID, getPhysicalList } from '@/api/peis/peis';
  import { message, Select, SelectProps } from 'ant-design-vue';

  const params = {  };
  const dataShowOption = ref<SelectProps['options']>([
    {
      value: '1',
      label: '列表模式',
    },
    {
      value: '2',
      label: '床位模式',
    },
  ]);
  const dataShowMode = ref('1'); //数据展示形式
  const checkedKeys = ref<Array<string | number>>([]);
  const [registerTable, { reload, getForm }] = useTable({
    title: '体检记录',
    api: getPhysicalList,
    columns: getBasicColumns(),
    useSearchForm: false,
    formConfig: getFormConfig(),
    showTableSetting: true,
    tableSetting: { fullScreen: true },
    showIndexColumn: false,
    rowKey: 'id',
    clickToRowSelect: false,
  });
  function getFormValues() {
    console.log(getForm().getFieldsValue());
  }
  // 选中事件
  function onSelectChange(selectedRowKeys: (string | number)[]) {
    checkedKeys.value = selectedRowKeys;
  }
  // 数据展示模式切换
  function handleDataShowChange(value, option) {
    console.log(value);
    console.log(option);
  }
</script>
